package cn.line5.filter;

import java.io.IOException;
import java.io.PrintWriter;

import cn.line5.seam.filter.FilterServletContext;
import cn.line5.seam.filter.RemoteFilter;

/**
 * <h1>用户登录和权限过滤器</h1>
 * 
 * @author Liu,Xiaojun
 * @since JDK1.6
 */
public class LoginFilter extends RemoteFilter{
	@Override
	public Boolean filter(FilterServletContext servletContext) throws Exception{
		System.out.println("filter:  " + servletContext.getComponentName() + ">>" + servletContext.getMethodName());
//		if (servletContext.getRequestType().intValue() == FilterServletContext.REQUEST_TYPE_AJAX.intValue()){
//			PrintWriter write = servletContext.getResponse().getWriter();
//			write.write("info:木有权限！");
//			write.close();
//			return false;
//		}
//		try {
//			servletContext.getResponse().sendRedirect("/system/");
//		} catch (IOException e) {
//			e.printStackTrace();
//		}
		return true;
	}
}